package org.example.springcloud_feign_consumer.controller;

import org.example.pojo.User;
import org.example.springcloud_feign_consumer.feign.Userfeign;
import org.example.springcloud_feign_consumer.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create 2021-03-11 17:01
 */
@RestController
public class Userscontroller {
    @Autowired
    Userfeign userfeign;

    @Autowired
    Userservice userservice;
    @RequestMapping("/consumer/{id}")
    public User getUser(@PathVariable Integer id){
        userservice.getUser(1);
      return userfeign.getUser(id);
    }
}
